
<template>
    <div class="ChangeForm">
        <Row>
            <Form ref="formValidate" :model="formValidate" :label-width="80">
          <!--      <Col span="24">
                    <Row>
                        <Col :xs="24" :sm="12" :md="12" :lg="8" :xl="6" :xxl="6" v-if="!isSP">
                            <Form-item label="全部案件" prop="allCase">
                                <i-switch v-model="formValidate.allCase" @on-change="searchSubmit('formValidate')" size="large" >
                                    <span slot="open">ON</span>
                                    <span slot="close">OFF</span>
                                </i-switch>
                            </Form-item>
                        </Col>
                    </Row>
                </Col>-->
            </Form>

        </Row>
    </div>
</template>
<script>
    export default {
        props: {
            formValidate: {
                type: Object,
                required: true
            },

            dataDict: {
                type: Object,
                required: true
            },
            loading: {
                type: Boolean,
                required: true,
                default: true
            },
            isSP: {
                type: Boolean,
                required: true,
                default: true
            }
        },
        data() {
            return {

            };
        },
        mounted() {

        },
        computed: {
            // dict: () => this.dataDict || []
        },
        methods: {
            init() { },
            // 查询
            handleSubmit(name) {
                if (this.loading) return;
                this.$refs[name].validate(valid => {
                    if (valid) {
                        this.$emit("getList", this.formValidate);
                    }
                });
            },
            handleReset(name) {
                this.$refs[name].resetFields();
                this.formValidate.contractNo = '';
                this.handleSubmit(name)
            },

            searchSubmit(name){
                let {allCase}  =this.formValidate;
                if(allCase){//查询全部案件：入账成功、已撤销、撤销审核中、撤销拒绝
                    this.formValidate.receiptStatus="creditSuccess,revokeExamine,revokeRefuse,revoke";
                }else{
                    this.formValidate.receiptStatus="creditSuccess";//入账成功
                }
                this.handleSubmit(name);

            }

        }
    };
</script>
<style scoped>
    .export-btn {
        margin-bottom: 16px;
    }
    .contract-close-btns {
        padding-bottom: 28px;
        display: flex;
        flex-flow: row;
        justify-content: center;
        align-items: center;
    }
</style>
